import React, { useState } from 'react'
import { useDispatch } from 'react-redux'
import { useSelector } from 'react-redux'
import { useNavigate, useSearchParams } from 'react-router-dom'
import { list1 } from '../../store/chengk'
import { Button, Card, Checkbox, NavBar } from 'antd-mobile'
import {
    Form,
    Input,
    Dialog,
    TextArea,
    DatePicker,
    Selector,
    Slider,
    Stepper,
    Switch,
} from 'antd-mobile'

function OrderList() {

    const navigate = useNavigate()
    const chengk = useSelector((state) => state.chengk)
    const dispatch = useDispatch()
    // const [value, setValue] = useState('')
    const onFinish = (values) => {

    }

    return (
        <div>

            <NavBar onBack={navigate(-1)}>新增乘客</NavBar>
            <div>
                <Button block color='primary' fill='outline' size='large' >
                    证件扫描
                </Button>
                <Card style={{ display: 'flex', }}  >
                    <span>乘客类型 </span>

                    <div >
                        <span><Checkbox defaultChecked /> 成人</span>
                        <span><Checkbox /> 儿童</span>
                        <span><Checkbox /> 学生</span>

                    </div>
                </Card>

                <Card>
                    <Form
                        name='form'
                        onFinish={onFinish}
                        footer={
                            <Button block color='warning' size='large' shape='rounded'>
                                提交
                            </Button>
                        }
                    >
                        <Form.Item
                            name='name'
                            label='姓名'
                            rules={[{ required: true, message: '姓名不能为空' }]}
                        >
                            <Input onChange={console.log} placeholder='与乘客证件一致' />
                        </Form.Item>
                        <Form.Item
                            
                            label='证件类型'
                            rules={[{ required: true, message: '姓名不能为空' }]}
                        >
                            <span>身份证</span>
                        </Form.Item>
                        <Form.Item
                            name='card'
                            label='证件号码'
                            rules={[{ required: true, message: '与乘客证件不符' }]}
                        >
                            <Input onChange={console.log} placeholder='与乘客证件一致' />
                        </Form.Item>

                    </Form>

                </Card>


            </div>



        </div>
    )
}

export default OrderList